﻿using System.Data.Entity.ModelConfiguration;
using ModelLayer;

namespace DataLayer.Configurations
{
    public class UserCartConfig : EntityTypeConfiguration<UserCart>
    {

        public UserCartConfig()
        {
            HasKey(x => x.CartId);

            HasOptional(x => x.User).WithMany(x => x.UserCarts).HasForeignKey(x => x.UserId);
            HasOptional(x => x.Product).WithMany(x => x.UserCarts).HasForeignKey(x => x.ProductId);


            ToTable("UserCart");
        }
    }
}
